<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title >网店流量管理-电商ERP系统</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" style="padding:15px;">
    <style type="text/css">
        .update {
            display: inline-block;
            margin-left: 15px;
            padding: 0 20px;
            height: 40px;
            line-height: 40px;
            font-size: 14px;
            background: #009789;
            color: #fff;
            text-align: center;
            border-radius: 3px;
            cursor: pointer;
        }

        .update i {
            display: inline-block;
            margin-right: 10px;
            vertical-align: middle;
            width: 30px;
            height: 30px;
            background: url();
        }
        .T-box {
            width: 400px;
            padding: 0 20px;
            text-align: left;
        }

        .T-box p {
            position: relative;
            height: 36px;
            line-height: 36px;
            font-size: 14px;
            margin-bottom: 15px;
        }

        .T-box p span {
            display: inline-block;
            padding-right: 15px;
            text-align: right;
            width: 110px;
            line-height: 36px;
            font-size: 14px;
        }

        .T-box p input, .T-box p select {
            width: 250px;
            padding: 0 5px;
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            border: 1px solid #d3d3d3;
            outline: none;
        }

        .T-box p i {
            padding: 0 10px;
            line-height: 36px;
            font-style: normal;
        }

        .T-box p b {
            display: inline-block;
            margin-left: 10px;
            cursor: pointer;
            width: 60px;
            height: 36px;
            line-height: 36px;
            background: #c33;
            color: #fff;
            text-align: center;
            font-size: 13px;
            font-weight: normal;
        }
        .yinc{display: none;}
    </style>
    <div class="layui-tab layui-tab-brief" lay-filter="demo">
        <ul class="layui-tab-title">
            <ul class="layui-tab-title">
                <li><a th:href="@{/tao/dashboard(shopId=${shopId})}">店铺首页</a></li>
                <li><a th:href="@{/shop/shop_traffic_tao(shopId=6)}">店铺访问明细</a></li>
       
                <li class="layui-this"><a th:href="@{/shop/goods_traffic_tao(shopId=6)}">商品访问明细</a></li>
            </ul>
        </ul>
    </div>

    <!-- content starts -->
<!--    <blockquote class="layui-elem-quote">订单总览</blockquote>-->

    <fieldset class="layui-elem-field">
        <legend>按条件搜索</legend>
        <div class="layui-field-box">
            <form class="layui-form layui-form-pane1" method="get" action="/shop/goods_traffic_tao">
                <input type="hidden" name="shopType" th:value="${shopType}">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <input type="text" name="goodsNum" th:value="${goodsNum}" placeholder="商品编码" style="width: 200px;" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="date" id="date" th:value="${date}" placeholder="日期" style="width: 200px;" class="layui-input" autocomplete="off">
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="shopId" id="shopId">
                                <option value="0" selected>请选择店铺</option>
                                <option  th:each="item: ${shops}" th:text="${item.name + ' - '+ item.typeName}" th:value="${item.id}">等待发货</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button type="submit" class="layui-btn layui-btn-normal">搜索</button>
                        <i>总共：<span style="color: red" th:text="${totalSize}"></span>条记录</i>
                    </div>

                    <div class="layui-inline">
                        <span id="add" class="layui-btn layui-btn-primary" >添加流量数据</span>
                    </div>
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-normal" th:href="@{/shop/goods_traffic_tao_import(date=${date})}">导入tao流量数据</a>
                    </div>
                </div>


            </form>
        </div>
    </fieldset>

    <!-- start dd-wrapper -->
    <link rel="stylesheet" href="/goods/order.css"/>
    <div class="dd-wrapper">
        <table class="dd-table">
            <tr>
                <th>序号</th>
                <th>商品</th>
                <th>访客</th>
                <th>浏览量</th>
                <th>下单数</th>
                <th>收藏量</th>
                <th>加购量</th>
            
                <th>备注</th>
                <th>日期</th>
                <th>创建日期</th>
            </tr>
            <tr th:each="item:${lists}">
                <td th:text="${itemStat.index+1}"></td>
                <td>
                    <div >
                        <p style="float:left">
                            <img th:src="${item.goodsImg}">
                        </p>
                        <p style="float:left">
                            <span  th:text="${#strings.abbreviate(item.goodsName,20)}" th:title="${item.goodsName}"></span>
                            <br />
                            <span th:text="${item.getGoodsNumber()}"></span>
                          
                            （<span th:text="${'ID:'+item.getGoodsId()}"></span>）
                        </p>

                    </div>
                </td>
                
                <td>
                    <span th:text="${item.visits}"></span>（<span th:text="${item.paidVisits}"></span>）
                </td>
                <td><span th:text="${item.views}"></span></td>
                <td>
                    <span th:text="${item.orders}"></span>（<span th:text="${item.paidOrders}"></span>）
                </td>
                <td>
                    <span th:text="${item.collects}"></span>（<span th:text="${item.paidCollects}"></span>）
                </td>
                <td>
                    <span th:text="${item.carts}"></span>（<span th:text="${item.paidCarts}"></span>）
                </td>
  
                <td><span th:text="${item.remark}"></span></td>
                <td><span th:text="${item.date}"></span></td>
                <td><span th:text="${item.createOn}"></span></td>
            </tr>
        </table>
    </div>
    <!-- end dd-wrapper -->
    <div class="layui-box layui-laypage layui-laypage-default pageBox">
        <paging:pager th:value="${pageIndex}" th:rows="${totalSize}" th:size="${pageSize}"/>
    </div>
    <script type="text/template" id="send-goods">
        <div class="T-box">
            <p><span>sku编码</span><input type="text" name="express_code"/></p>
            <p class="T-result"><span>&nbsp;</span><em id="erro"></em></p>
        </div>
    </script>
    <script type="text/javascript" src="/goods/Tips/Tips.min.js"></script>
    <script type="text/javascript">
        var layer;
        var $;
        var windowOpen;
        layui.use(['laydate', 'jquery', 'form', 'layer'], function () {
            var laydate = layui.laydate;
            $ = layui.jquery;
            var form = layui.form;
            layer = layui.layer;
            laydate.render({
                elem: '#date'
            });

            $(function () {
                var status = '[[${status}]]';
                $("#status").val(status);
                $("#shopId").val('[[${shopId}]]');
                //form.render(); //更新全部
                form.render('select'); //刷新select选择框渲染

                $("#add").click(function(){
                    layer.open({
                        type: 2,
                        title: '添加商品流量记录',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['580px', '75%'],
                        content: '/shop/goods_traffic_tao_add'
                    });
                })
                

            })//jq init






        });

    </script>

</div>
</body>
<html>
